package com.zjitc;

import com.zjitc.config.JavaConfigDemo1;
import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:48
 * @description:
 */
public class App3 {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(JavaConfigDemo1.class);
    User u2 = context.getBean("u2",User.class);
    System.out.println(u2);
    Teacher t2 = context.getBean("teacher",Teacher.class);
  }
}
